From beb802a8cfa396fe509c7b6f9e708b82a4a2a6d9 Mon Sep 17 00:00:00 2001 From: Max Semenik Date: Fri, 19 Aug 2011 18:27:35 +0000 Subject: [PATCH] Don't check for each database's availability twice. This halves the number of ugly message boxes seen during CLI installation on Windows if Oracle is not installed, but its bindings for PHP are. --- includes/installer/Installer.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 354475383d..a25a94dd51 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -333,12 +333,14 @@ abstract class Installer { $this->settings[$var] = $GLOBALS[$var]; } + $compiledDBs = array(); foreach ( self::getDBTypes() as $type ) { $installer = $this->getDBInstaller( $type ); if ( !$installer->isCompiled() ) { continue; } + $compiledDBs[] = $type; $defaults = $installer->getGlobalDefaults(); @@ -350,6 +352,7 @@ abstract class Installer { } } } + $this->setVar( '_CompiledDBs', $compiledDBs ); $this->parserTitle = Title::newFromText( 'Installer' ); $this->parserOptions = new ParserOptions; // language will be wrong :( @@ -622,19 +625,13 @@ abstract class Installer { protected function envCheckDB() { global $wgLang; - $compiledDBs = array(); $allNames = array(); foreach ( self::getDBTypes() as $name ) { - if ( $this->getDBInstaller( $name )->isCompiled() ) { - $compiledDBs[] = $name; - } - $allNames[] = wfMsg( 'config-type-' . $name ); + $allNames[] = wfMsg( "config-type-$name" ); } - $this->setVar( '_CompiledDBs', $compiledDBs ); - - if ( !$compiledDBs ) { + if ( !$this->getVar( '_CompiledDBs' ) ) { $this->showError( 'config-no-db', $wgLang->commaList( $allNames ) ); // @todo FIXME: This only works for the web installer! return false; -- 2.20.1